package com.xayy.health.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.spring.mvc.validator.Group;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author Nie
 * @version V1.0
 * @date 2023/4/10 14:34
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "HEALTH.health_assess_record")
public class HealthAssessRecord extends BaseModel<Long> {
    /**
     * 主键
     */
    @Id
    @Column(name = "id")
    @KeySql(dialect = IdentityDialect.MYSQL)
    @NotNull(groups = Group.Update.class, message = "主键不能为空")
    @ApiModelProperty(value = "主键", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    private Long id;

    /**
     * 卫星标识
     */
    @ApiModelProperty(value = "卫星标识")
    private Long satelliteMid;

    /**
     * 卫星名称
     */
    @ApiModelProperty(value = "卫星名称")
    private String satelliteName;

    /**
     * 上级id
     */
    @ApiModelProperty(value = "上级id")
    private Long parentId;

    /**
     * 部件id
     */
    @ApiModelProperty(value = "部件id")
    private Long componentMid;

    /**
     * 部件名称
     */
    @ApiModelProperty(value = "部件名称")
    private String componentName;

    /**
     * 评估算法名称
     */
    @ApiModelProperty(value = "评估算法名称")
    private String algorithmName;

    /**
     * 故障次数
     */
    @ApiModelProperty(value = "故障次数")
    private Integer faultNum;

    /**
     * 故障等级
     */
    @ApiModelProperty(value = "故障等级")
    private String faultLevel;

    /**
     * 故障分值
     */
    @ApiModelProperty(value = "故障分值")
    private Integer faultScore;

    /**
     * 遥测参数名称
     */
    @ApiModelProperty(value = "遥测参数名称")
    private String telemetryName;

    /**
     * 遥测数据时间
     */
    @ApiModelProperty(value = "遥测数据时间")
    private Date telemetryTime;

    /**
     * 性能分值
     */
    @ApiModelProperty(value = "性能分值")
    private Integer performanceScore;

    /**
     * 健康分值
     */
    @ApiModelProperty(value = "健康分值")
    private Integer healthScore;

    /**
     * 健康状态等级
     */
    @ApiModelProperty(value = "健康状态等级")
    private String healthLevel;

    /**
     * 评估时间
     */
    @ApiModelProperty(value = "评估时间")
    private Date fractionTime;

    /**
     * 登录用户
     */
    @ApiModelProperty(value = "登录用户")
    private String createdBy;

    @Override
    public Long idValue() {
        return id;
    }
}
